<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="java.util.*,java.lang.*,com.yaoandw.lucene.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>search engine</title>
<link rel="stylesheet" type="text/css" href="css/main.css" />
</head>
<body>
<form action="SearchServlet">
<input style="width:520px;height:22px" name="query" value="<%=request.getAttribute("query") %>"/>
<input class="input_search" type="submit" value="search"/>
</form>
<%
List<RecordResult> results = (List<RecordResult>)request.getAttribute("results");
for(RecordResult result : results){
%>
<a href='<%=result.getLink() %>' target='blank'><%=result.getTitle() %></a><br>
<p class='p_summary'><%=result.getSummary() %></p>
<span class='span_link'><%=result.getLink() %></span><span class='span_link'><%=result.getTxtFileLink() %></span><br><br>
<%
}
%>
<%
int startDisplayPage = (Integer)request.getAttribute("startDisplayPage");
int endDisplayPage = (Integer)request.getAttribute("endDisplayPage");
int pageNo = (Integer)request.getAttribute("pageNo");
int totalCnt = (Integer)request.getAttribute("totalCnt");
double cost = (Double)request.getAttribute("cost");
String query = (String)request.getAttribute("query");
for(int i = startDisplayPage;i<=endDisplayPage;i++){
	if(pageNo == i)
		out.print("<strong>"+i+"</strong>");
	else
		out.print("<a href='SearchServlet?query="+query+"&pageNo="+i+"'>"+i+"</a>");
}
%> <span style="margin-left: 120px;font-size: 12px;color: #999;"> 找到"<%=query %>" 相关内容 <%=totalCnt %> 个（用时 <%=cost %> 秒）</span>
</body>
</html>